home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 April: Mac OS SDK / Dev.CD Apr 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / RIncludes / InputSprocket.r < prev    next >
Encoding:
Text File  |  1998-08-17  |  6.4 KB  |  176 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        InputSprocket.r
  3.  
  4.      Contains:    Games Sprockets: InputSprocket interfaaces
  5.  
  6.      Version:    Technology:    Input Sprocket 1.3
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1996-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17.  
  18. #ifndef __INPUTSPROCKET_R__
  19. #define __INPUTSPROCKET_R__
  20.  
  21. #ifndef __CONDITIONALMACROS_R__
  22. #include "ConditionalMacros.r"
  23. #endif
  24.  
  25. #define kISpDeviceClass_SpeechRecognition  'talk'
  26. #define kISpDeviceClass_Mouse             'mous'
  27. #define kISpDeviceClass_Keyboard         'keyd'
  28. #define kISpDeviceClass_Joystick         'joys'
  29. #define kISpDeviceClass_Wheel             'whel'
  30. #define kISpDeviceClass_Pedals             'pedl'
  31. #define kISpDeviceClass_Levers             'levr'
  32. #define kISpDeviceClass_Tickle             'tckl'                /*  a device of this class requires ISpTickle */
  33. #define kISpDeviceClass_Unknown         '????'
  34.  
  35. #define kISpKeyboardID_Apple             'appl'                /*  currently this applies to _all_ keyboards */
  36.  
  37. /*    Preliminary Rez interfaces for InputSprocket.
  38.  *
  39.  *    Specifically, this file is intended to make the development process 
  40.  *    easier. Now the default keyboard settings can be specified in a rez
  41.  *    file which should be easy to modify when new needs are added and/or
  42.  *    the order of needs are changed.
  43.  *    
  44.  *    Note: When the ISp keyboard driver undergoes a major revision, it will
  45.  *    almost certainly use a newer format to store it's settings. It will,
  46.  *    however, continue to be able to read this format, but it will no longer
  47.  *    write it.
  48.  *    
  49.  *    Currently, only a template is provided for keyboard settings, since
  50.  *    keyboard is the one that is the most difficult to recreate, and since
  51.  *    each driver uses a private format for its settings. For all other 
  52.  *    devices, you should continue to include the 'tset' resources copied
  53.  *    from your prefs file. Make sure you include references to them in
  54.  *     the set list resource ('setl').
  55.  *
  56.  *    The 'setl' resource contains a length value of the 'tset' is refers to.
  57.  *    This obviously won't do for use in Rez, so the ISpLib 1.2.1 has been
  58.  *    modified to allow a zero value (in which case, it cannot check to
  59.  *    verify that it is the correct length.) Because of this change:
  60.  *    applications that use this template WILL REQUIRE INPUTSPROCKET 1.2.1
  61.  *    OR LATER... you have been warned.
  62.  *
  63.  */
  64.  
  65.  
  66. /*----------------------------isap • InputSprocket application resource ----------------*/
  67. type 'isap'
  68. {
  69.         flags:
  70.             fill bit[24];
  71.             fill bit[6];
  72.             boolean        doesNotCallISpInit, callsISpInit;                
  73.             boolean        notUseInputSprocket, usesInputSprocket;
  74.  
  75.         fill long[3];
  76. };
  77.  
  78.  
  79. /*----------------------------setl • a set list resource -------------------------------*/
  80. type 'setl'
  81. {
  82.     unsigned longint    currentVersion = 2;
  83.     
  84.     unsigned longint = $$Countof(Needs);
  85.     array Needs
  86.     {
  87.         pstring[63];                                        /* the name of the set */
  88.         unsigned longint length;                            /* the length of the set */
  89.         literal longint    deviceClass;                        /* the device class for the set */
  90.         literal longint    deviceIdentifier;                    /* the device identifier for the set */
  91.     
  92.         flags:
  93.             fill bit[24];
  94.             fill bit[3];
  95.             fill bit;                                        /* set from custom (not supported) */
  96.             fill bit;                                        /* set from driver (not supported) */
  97.             boolean        notApplSet, isApplSet;                /* true if the set is from application and not a default */
  98.             boolean        notDefaultSet, isDefaultSet;        /* true if this is the default for its device */
  99.             fill bit;
  100.         
  101.         fill long[3];
  102.         integer    resourceID;                                    /* the resource ID of the set */
  103.         fill word;
  104.     };
  105. };
  106.  
  107.  
  108.  
  109. /*----------------------------tset • a saved set ---------------------------------------*/
  110. /*----------------------------only valid for keyboard tsets ----------------------------*/
  111. type 'tset'
  112. {
  113.     unsigned longint    supportedVersion = 1;
  114.     
  115.     unsigned longint = $$Countof(ExpandedNeeds);
  116.     wide array ExpandedNeeds
  117.     {
  118. keyCode:
  119.         unsigned hex integer noKey = 0x8000,                /* virtual key code        */
  120.             /* NOTE: names of keys refer to the Apple Extended English Keyboard         */
  121.             /* Non-english keyboards have slightly different keycodes                */
  122.             /* In all cases, the actual virtual key code is stored for that device    */
  123.             tildeKey = 0x0032, n1Key = 0x0012, n2Key = 0x0013, n3Key = 0x0014, n4Key = 0x0015,
  124.             n5Key = 0x0017, n6Key = 0x0016, n7Key = 0x001A, n8Key = 0x001C, n9Key = 0x0019,
  125.             n0Key = 0x001D, minusKey = 0x001B, plusKey = 0x0018, deleteKey = 0x0033,
  126.             
  127.             tabKey = 0x0030, aKey = 0x0000, zKey = 0x000D, eKey = 0x000E, rKey = 0x000F, 
  128.             tKey = 0x0011, yKey = 0x0010, uKey = 0x0020, iKey = 0x0022, oKey = 0x001F,
  129.             pKey = 0x0023, lBraceKey = 0x0021, rBraceKey = 0x001E, backslashKey = 0x002A,
  130.             
  131.             capsKey = 0x0039, aKey = 0x0000, sKey = 0x0001, dKey = 0x0002, fKey = 0x0003, 
  132.             gKey = 0x0005, hKey = 0x0004, jKey = 0x0026, kKey = 0x0028, lKey = 0x0025, 
  133.             colonKey = 0x0029, quoteKey = 0x0027, returnKey = 0x0024,
  134.             
  135.             shiftKey = 0x0038, zKey = 0x0006, xKey = 0x0007, cKey = 0x0008, vKey = 0x0009,
  136.             bKey = 0x0001,  nKey = 0x002D, mKey = 0x002E, lessThanKey = 0x002B, 
  137.             greaterThanKey = 0x002F, slashKey = 0x002C,
  138.             
  139.             controlKey = 0x003B, optionKey = 0x003A, commandKey = 0x0037, spaceKey = 0x0031,
  140.             rShiftKey = 0x003C, rOptionKey = 0x003D, rControlKey = 0x003E, 
  141.  
  142.         
  143.             escKey = 0x0035, f1Key = 0x007a, f2Key = 0x0078, f3Key = 0x0063, f4Key = 0x0076,
  144.             f5Key = 0x0060, f6Key = 0x0061, f7Key = 0x0063, f8Key = 0x0064, f9Key = 0x0065,
  145.             f10Key = 0x006D, f10Key = 0x006D, f11Key = 0x0067, f12Key = 0x006F, 
  146.             f13Key = 0x0069, f14Key = 0x006B, f15Key = 0x0071,
  147.             
  148.             helpKey = 0x0072, homeKey = 0x0073, pageUpKey = 0x0074,
  149.             delKey = 0x0075, endKey = 0x0077, pageDownKey = 0x0079
  150.             
  151.             upKey = 0x007E, leftKey = 0x007B, downKey = 0x007D, rightKey = 0x007C,
  152.             
  153.             kdpClearKey = 0x0047, kpdEqualKey = 0x0051, kpdSlashKey = 0x004B, kpdStarKey = 0x0043,
  154.             kpd7Key = 0x0059, kpd8Key = 0x005B, kpd9Key = 0x005C, kpdMinusKey = 0x004E,
  155.             kpd4Key = 0x0056, kpd5Key = 0x0057, kpd6Key = 0x0058, kpdPlusKey = 0x0045,
  156.             kpd1Key = 0x0053, kpd2Key = 0x0054, kpd3Key = 0x0055, kpdEnterKey = 0x004C,
  157.             kpd0Key = 0x0052, kpdDecimalKey = 0x0041;
  158.         
  159.         /* Modifiers required to be down */
  160.         boolean        rControlOff, rControlOn;
  161.         boolean        rOptionOff, rOptionOn;
  162.         boolean        rShiftOff, rShiftOn;
  163.         boolean        controlOff, controlOn;
  164.         boolean        optionOff, optionOn;
  165.         fill bit;                                            /* capsLockOff, capsLockOn*/
  166.         boolean        shiftOff, shiftOn;
  167.         boolean        commandOff, commandOn;
  168.  
  169.         fill byte;                                            
  170.     };
  171. };
  172.  
  173.  
  174. #endif /* __INPUTSPROCKET_R__ */
  175.  
  176.